package h.c.z.designPattern.B01_Strategy;

/**
 * 说明：折扣
 * @author jinsicao
 * @version 2016年12月17日
 */
public class RebateStrategy implements Strategy {
	
	/**
	 * 折扣率，大于0小于1
	 */
	private double moneyRebate = 1;
	
	public RebateStrategy(double moneyRebate) {
		this.moneyRebate = moneyRebate;
	}

	@Override
	public double calculatePrice(double goodsPrice, int quantity) {
		return goodsPrice * quantity * this.moneyRebate;
	}

}
